#include <iostream>
#include <cstdio>
#include <cstring>
#include <map>

using namespace std;

const int maxn=100005;
int _d[12][maxn];
int v[maxn*2],nxt[maxn*2],g[maxn];
double p[maxn];
map<int,int> rts;
int n,en,cnt_rts;

inline void addEdge(const int &x,const int &y){
  v[en]=y;nxt[en]=g[x];g[x]=en++;
  v[en]=x;nxt[en]=g[y];g[y]=en++;
}

int *d;
void dfs(int p,int fa){
  for(int j=g[p];~j;j=nxt[j]){
    if(v[j]==fa) continue;
    d[v[j]]=d[p]+1;
    dfs(v[j],p);
  }
}

double count(){
  double ans,sum;
  ans=sum=0;
  for(int i=1;i<=n;i++) ans+=p[i]*d[i]*d[i],sum+=p[i]*d[i];
  for(int i=1;i<=n;i++) ans+=p[i]*d[i]*(sum-p[i]*d[i]);
  return ans;
}

inline int read(){
  char c;int r;bool f=0;
  for(c=getchar();c>'9'||c<'0';c=getchar()) if(c=='-') f=1;
  for(r=0;c<='9'&&c>='0';c=getchar()) r=r*10+c-'0';
  if(f) return -r;
  else return r;
}

int main(){
  int id,m;

  freopen("network.in","r",stdin);
  freopen("network.out","w",stdout);
  
  memset(g,-1,sizeof(g));
  id=read();n=read();m=read();
  for(int i=1;i<=n;i++){ p[i]=read();if(p[i]!=1) p[i]=0;}
  for(int i=1;i<n;i++){
    int u,v;
    u=read();v=read();
    addEdge(u,v);
  }
  while(m--){
    int op,x;
    op=read();x=read();
    if(op==1){
      double pos;
      scanf("%lf",&pos);
      pos/=100;
      p[x]=p[x]+pos-2*p[x]*pos;
    }else{
      if(id==15||id==16){
	if(rts.count(x)) d=_d[rts[x]];
	else{
	  d=_d[rts[x]=cnt_rts++];
	  d[x]=0;
	  dfs(x,0);
	}
      }else{
	d=_d[0];
	d[x]=0;
	dfs(x,0);
      }
      printf("%.6lf\n",count());
    }
  }
  
  fclose(stdin);
  fclose(stdout);

  return 0;
}
  
